﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="LevelDefine.aspx.cs" Inherits="Jy123.Web.Manage.User.LevelDefine" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>用户等级定义管理</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="../css/custom/jquery.ui.css" rel="stylesheet" type="text/css" />
    <link href="../css/main.css" rel="stylesheet" type="text/css" />

    <script src="../js/jquery.js" type="text/javascript"></script>

    <script src="../js/jquery.ui.js" type="text/javascript"></script>

    <script src="../js/main.js" type="text/javascript"></script>
</head>
<body>
<h4>
        <a href="#"><span>用户等级定义管理</span></a></h4>
    <form id="form1" runat="server">
    <div class="register">
        <h4>
            增加分类</h4>
    </div>
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            DataSourceID="SqlDataSource1" DataKeyNames="ID" CssClass="tblist">
            <Columns>
                <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" 
                    ReadOnly="True" SortExpression="ID" Visible="False" />
                <asp:BoundField DataField="LevelName" HeaderText="等级名称" />
                <asp:BoundField DataField="RequirMoney" HeaderText="资产线" />
                <asp:BoundField DataField="Description" HeaderText="描述" />
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" 
                    HeaderText="操作" />                    
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            DeleteCommand="DELETE FROM [User_Level] WHERE [ID] = @ID" 
            InsertCommand="INSERT INTO [User_Level] ([LevelName], [RequirMoney], [Description]) VALUES (@LevelName, @RequirMoney, @Description)" 
            SelectCommand="SELECT [ID], [LevelName], [RequirMoney], [Description] FROM [User_Level] ORDER BY [RequirMoney]" 
            
        UpdateCommand="UPDATE [User_Level] SET [LevelName] = @LevelName, [RequirMoney] = @RequirMoney, [Description] = @Description WHERE [ID] = @ID">
            <DeleteParameters>
                <asp:Parameter Name="ID" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="LevelName" Type="String" />
                <asp:Parameter Name="RequirMoney" Type="Decimal" />
                <asp:Parameter Name="Description" Type="String" />
                <asp:Parameter Name="ID" Type="Int32" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="LevelName" Type="String" />
                <asp:Parameter Name="RequirMoney" Type="Decimal" />
                <asp:Parameter Name="Description" Type="String" />
            </InsertParameters>
        </asp:SqlDataSource>
        <div class="allform">
        <h5>
        </h5>
        <ul>
            <li class="b">增加：</li>
            <li>
                等级名称：<asp:TextBox ID="txtLevelName" runat="server" ValidationGroup="input" 
                    CssClass="text"></asp:TextBox>
                资产要求：<asp:TextBox ID="txtRequirMoney" runat="server" ></asp:TextBox>描述：<asp:TextBox 
                    ID="txtDescription" runat="server"></asp:TextBox>
            </li>
            <li>
                <asp:RequiredFieldValidator ID="RequireName" runat="server" ControlToValidate="txtLevelName"
                    Display="Dynamic" ErrorMessage="分类名称不能为空" ValidationGroup="input"></asp:RequiredFieldValidator>&nbsp;<asp:RegularExpressionValidator 
                    ID="RegularExpressionValidator1" runat="server" 
                    ControlToValidate="txtRequirMoney" ErrorMessage="现金格式不正确" 
                    ValidationExpression="^[0-9]*\.?[0-9]{0,2}$"></asp:RegularExpressionValidator>
            </li>
                    
            <li>
                <asp:Button ID="btnAlterClass" runat="server" Text="确定" OnClick="btnAlterClass_Click"
                    CssClass="button" ValidationGroup="input" /><asp:HiddenField ID="TxtclassID" runat="server"
                        Value="0" />
            </li>
        </ul>
    </div>
    </form>
</body>
</html>
